package com.dlu.safe_construction.common;

/**
 * Created by  lijiaxing on 2022/3/30 10:04
 *
 * @author lijiaxing
 */
public interface CommonEnum {

    enum OwnerSearchBy {
        SEARCH_BY_OWNER_ID(0, "通过业主id查询"),
        SEARCH_BY_OWNER_NAME(1, "通过业主姓名查询"),
        SEARCH_BY_OWNER_PHONE(2, "通过业主电话"),
        SEARCH_BY_OWNER_STATUS(3, "通过业主状态");

        public int status;
        public String desc;

        OwnerSearchBy(int status, String desc) {
            this.status = status;
            this.desc = desc;
        }

        public boolean isThisStatus(int status) {
            return this.status == status;
        }
    }

    enum OwnerDeleteBy {
        DELETE_BY_OWNER_ID(0, "通过ownerID删除"),
        DELETE_BY_OWNER_PHONE(1, "通过业主电话删除");

        public int status;
        public String desc;

        OwnerDeleteBy(int status, String desc) {
            this.status = status;
            this.desc = desc;
        }

        public boolean isThisStatus(int status) {
            return this.status == status;
        }
    }

    enum OwnerStatusEnum {
        COMMUNITY_OWNER(0, "社区业主"),
        TEMPORAYR_OWNER(1, "临时业主");

        public int status;
        public String desc;

        OwnerStatusEnum(int status, String desc) {
            this.status = status;
            this.desc = desc;
        }

        public boolean isThisStatus(int status) {
            return this.status == status;
        }
    }

    enum SpaceSearchBy {
        SEARCH_BY_SPACE_ID(0, "通过车位id查询"),
        SEARCH_BY_AREA_ID(1, "通过停车场id查询"),
        SEARCH_BY_IN_SPACE_STATUS(2,"在停车场的车辆"),
        SEARCH_BY_STATUS(3,"通过状态查询"),
        SEARCH_BY_CAR_ID(4,"通过车牌号查询"),
        SEARCH_BY_OWNER_PHONE(5,"通过车主手机号")
        ;

        public int status;
        public String desc;

        SpaceSearchBy(int status, String desc) {
            this.status = status;
            this.desc = desc;
        }

        public boolean isThisStatus(int status) {
            return this.status == status;
        }
    }

    enum SpaceDeleteBy {
        DELETE_BY_SPACE_ID(0, "通过车位id删除"),
        DELETE_BY_AREA_ID(1, "通过停车场id删除");

        public int status;
        public String desc;

        SpaceDeleteBy(int status, String desc) {
            this.status = status;
            this.desc = desc;
        }

        public boolean isThisStatus(int status) {
            return this.status == status;
        }
    }

    enum CarStatusEnum {
        COMMUNITY_CAR(0, "社区车辆"),
        TEMPORAYR_CAR(1, "临时车辆");

        public int status;
        public String desc;

        CarStatusEnum(int status, String desc) {
            this.status = status;
            this.desc = desc;
        }

        public boolean isThisStatus(int status) {
            return this.status == status;
        }
    }

    enum CarDeleteBy {
        DELETE_BY_CAR_ID(0, "通过车牌号删除"),
        DELETE_BY_OWNER_ID(1, "业主ID删除");

        public int status;
        public String desc;

        CarDeleteBy(int status, String desc) {
            this.status = status;
            this.desc = desc;
        }

        public boolean isThisStatus(int status) {
            return this.status == status;
        }
    }

    enum IllRecordDeleteBy {
        DELETE_BY_ILL_RECORD_ID(0, "通过记录号删除"),
        DELETE_BY_OWNER_ID(1, "业主ID删除");

        public int status;
        public String desc;

        IllRecordDeleteBy(int status, String desc) {
            this.status = status;
            this.desc = desc;
        }

        public boolean isThisStatus(int status) {
            return this.status == status;
        }
    }

    enum IllRecordListBy {
        LIST_BY_ILL_RECORD_ID(0, "通过记录号查询"),
        LIST_BY_OWNER_ID(1, "业主ID查询"),
        LIST_BY_DATA(2, "时间查询"),
        LIST_BY_CAR_ID(3, "车牌号查询"),
        LIST_BY_OWNER_PHONE(4, "手机号查询");

        public int status;
        public String desc;

        IllRecordListBy(int status, String desc) {
            this.status = status;
            this.desc = desc;
        }

        public boolean isThisStatus(int status) {
            return this.status == status;
        }
    }

    enum CarSearchBy {
        SEARCH_BY_CAR_ID(0, "通过车牌号查询"),
        SEARCH_BY_CAR_STATUS(1, "通过车辆状态"),
        SEARCH_BY_OWNER_ID(2, "业主ID查询");

        public int status;
        public String desc;

        CarSearchBy(int status, String desc) {
            this.status = status;
            this.desc = desc;
        }

        public boolean isThisStatus(int status) {
            return this.status == status;
        }
    }


    enum SpaceStatus {
        NO_PARK(0, "空车位"),
        NORM_PARK(1, "规范停车"),
        UN_NORM_PARK(2, "不规范停车");

        public int status;
        public String desc;

        SpaceStatus(int status, String desc) {
            this.status = status;
            this.desc = desc;
        }

        public boolean isThisStatus(int status) {
            return this.status == status;
        }
    }

    enum ScoreGrade {
        GRADE_1(100, 95, 0.8),
        GRADE_2(95, 90, 0.9),
        GRADE_3(90, 80, 1),
        GRADE_4(80, 70, 1.1),
        GRADE_5(70, 60, 1.2),
        GRADE_6(60, 0, 1.5);

        public int maxScore;
        public int minScore;
        public double grade;

        ScoreGrade(int maxScore, int minScore, double grade) {
            this.maxScore = maxScore;
            this.minScore = minScore;
            this.grade = grade;
        }

        public boolean inThisGrade(int score) {
            return this.maxScore >= score && this.minScore < score;
        }
    }

    enum LatterJudge {

        LATTER_A_Z(90, 65);

        public int maxAscii;
        public int minAscii;

        LatterJudge(int maxAscii, int minAscii) {
            this.maxAscii = maxAscii;
            this.minAscii = minAscii;
        }

        public boolean isLatter(char s) {
            int sAscii = s;
            return sAscii >= minAscii && sAscii <= maxAscii;
        }
    }
}
